package com.woniuxy.verify.bean;

import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.*;
import java.util.Date;

/**
 * @author linke
 * @version 1.0
 * @className: UserBean
 * @description: TODO 类描述
 * @date 2021/11/14 12:42
 */
@Data
public class UserBean {
    private Long id;

    @NotNull(message = "用户名不能为null！")
    @NotEmpty(message = "用户名必须要有值！")
    @Size(min = 2,max = 8,message = "用户名的长度：[2,8]位！")
    private String userName;

    @NotEmpty(message = "登录名必须要有值！")
    @Size(min = 6,max = 8,message = "登录名的长度：[6,8]位！")
    private String loginName;

    @NotEmpty(message = "密码必须要有值！")
    @Size(min = 6,max = 12,message = "密码的长度：[6,12]位！")
    private String password;

    @Max(value = 60,message = "年龄过大，不能注册！")
    @Min(value = 18,message = "未成年人，不能注册！")
    private Integer age;
    /**
     * 是否婚配
     */
    @AssertFalse(message = "你大爷的，你都结婚，还来？")
    private boolean marray;
    /**
     * 个人收入
     */
    @Digits(integer = 10,fraction = 2,message = "你钱太多了，别吹NB了！")
    @Min(value = 50000,message = "多找爸妈要点钱再来，或来蜗牛培训一段时间再说！")
    private double income;
    /**
     * 个人爱好
     */

    private String[] hobbys;
    /**
     * 出生日期
     */
    @Past(message = "还没出生的小屁孩，滚蛋！")
    private Date birthday;
}
